#include-once
#include '..\Editors.au3'

Global Const $gzEDITORS_IDAUTOITFORMDESIGNER = _Editors_Register('AutoIt3 Form Designer', _
			'form.au3', __AutoItFormDesigner_MessageHandler, __AutoItFormDesigner_NotifyHandler)

Local $__gAutoItFormDesigner_hWnd = 0

Func __AutoItFormDesigner_MessageHandler($uMsg, $vParam, ByRef $rParam)
	Switch $uMsg
		Case $gnEDITORS_EM_POSTREGISTER	;$gnEDITORS_EM_POSTREGISTER, $zEditorId
		Case $gnEDITORS_EM_CREATE		;$gnEDITORS_EM_CREATE, $hParentView, $aClientSize
			$__gAutoItFormDesigner_hWnd = GUICreate('AutoIt Form Designer', _
						$aClientSize[0], $aClientSize[1], $aClientSize[2], $aClientSize[3], _
						BitOR($WS_CHILD, $WS_VISIBLE), $WS_EX_CONTROLPARENT, $hParentView)
		Case $gnEDITORS_EM_DESTROY		;$gnEDITORS_EM_DESTROY, 0, 0
			GUIDelete($__gAutoItFormDesigner_hWnd)
		Case $gnEDITORS_EM_ACTIVATE		;$gnEDITORS_EM_ACTIVATE, $aDocumentIds, $bSameEditor
			;$aDocumentIds[0]: New Document, $aDocumentIds[1]: Old Document

		Case $gnEDITORS_EM_DEACTIVATE	;$gnEDITORS_EM_ACTIVATE, $sDocumentId

	EndSwitch
EndFunc

Func __AutoItFormDesigner_NotifyHandler($uCode, $vParam, ByRef $rParam)
	Switch $uCode

	EndSwitch
EndFunc
